.class public Lcom/glympse/platform/common/CorrectedTime;
.super Ljava/lang/Object;
.source "CorrectedTime.java"


# static fields
.field public static ms_fGpsTimeBiasSet:Z

.field public static ms_fServerTimeBiasSet:Z

.field public static ms_lGpsTimeBias:J

.field public static ms_lServerTimeBias:J

.field protected static final ms_oSync:Ljava/lang/Object;


# direct methods
.method static constructor <clinit>()V
    .locals 4

    .prologue
    const-wide/16 v2, 0x0

    const/4 v1, 0x0

    .line 16
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    sput-object v0, Lcom/glympse/platform/common/CorrectedTime;->ms_oSync:Ljava/lang/Object;

    .line 18
    sput-boolean v1, Lcom/glympse/platform/common/CorrectedTime;->ms_fGpsTimeBiasSet:Z

    .line 19
    sput-boolean v1, Lcom/glympse/platform/common/CorrectedTime;->ms_fServerTimeBiasSet:Z

    .line 20
    sput-wide v2, Lcom/glympse/platform/common/CorrectedTime;->ms_lGpsTimeBias:J

    .line 21
    sput-wide v2, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    .line 14
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 14
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static GetBias()J
    .locals 3

    .prologue
    .line 99
    sget-object v0, Lcom/glympse/platform/common/CorrectedTime;->ms_oSync:Ljava/lang/Object;

    monitor-enter v0

    .line 101
    :try_start_0
    sget-boolean v1, Lcom/glympse/platform/common/CorrectedTime;->ms_fGpsTimeBiasSet:Z

    if-eqz v1, :cond_0

    sget-wide v1, Lcom/glympse/platform/common/CorrectedTime;->ms_lGpsTimeBias:J

    :goto_0
    monitor-exit v0

    return-wide v1

    :cond_0
    sget-wide v1, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    goto :goto_0

    .line 99
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public static GetTime()J
    .locals 5

    .prologue
    .line 108
    sget-object v0, Lcom/glympse/platform/common/CorrectedTime;->ms_oSync:Ljava/lang/Object;

    monitor-enter v0

    .line 110
    :try_start_0
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    sget-boolean v3, Lcom/glympse/platform/common/CorrectedTime;->ms_fGpsTimeBiasSet:Z

    if-eqz v3, :cond_0

    sget-wide v3, Lcom/glympse/platform/common/CorrectedTime;->ms_lGpsTimeBias:J

    :goto_0
    add-long/2addr v1, v3

    monitor-exit v0

    return-wide v1

    :cond_0
    sget-wide v3, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    goto :goto_0

    .line 108
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public static GetTime(J)J
    .locals 3
    .parameter "lSystemTime"

    .prologue
    .line 117
    sget-object v0, Lcom/glympse/platform/common/CorrectedTime;->ms_oSync:Ljava/lang/Object;

    monitor-enter v0

    .line 119
    :try_start_0
    sget-boolean v1, Lcom/glympse/platform/common/CorrectedTime;->ms_fGpsTimeBiasSet:Z

    if-eqz v1, :cond_0

    sget-wide v1, Lcom/glympse/platform/common/CorrectedTime;->ms_lGpsTimeBias:J

    :goto_0
    add-long/2addr v1, p0

    monitor-exit v0

    return-wide v1

    :cond_0
    sget-wide v1, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    goto :goto_0

    .line 117
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public static SetGpsTime(J)V
    .locals 0
    .parameter "lGpsTime"

    .prologue
    .line 63
    return-void
.end method

.method public static SetServerTime(J)V
    .locals 9
    .parameter "lServerTime"

    .prologue
    .line 68
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 69
    .local v0, lCurrent:J
    sget-object v4, Lcom/glympse/platform/common/CorrectedTime;->ms_oSync:Ljava/lang/Object;

    monitor-enter v4

    .line 72
    sub-long v2, p0, v0

    .line 86
    .local v2, lServerTimeBias:J
    :try_start_0
    sget-boolean v5, Lcom/glympse/platform/common/CorrectedTime;->ms_fServerTimeBiasSet:Z

    if-eqz v5, :cond_0

    .line 87
    sget-wide v5, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    cmp-long v5, v2, v5

    if-gtz v5, :cond_0

    .line 88
    sget-wide v5, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    sub-long/2addr v5, v2

    const-wide/16 v7, 0x3a98

    cmp-long v5, v5, v7

    if-ltz v5, :cond_1

    .line 90
    :cond_0
    sput-wide v2, Lcom/glympse/platform/common/CorrectedTime;->ms_lServerTimeBias:J

    .line 91
    const/4 v5, 0x1

    sput-boolean v5, Lcom/glympse/platform/common/CorrectedTime;->ms_fServerTimeBiasSet:Z

    .line 69
    :cond_1
    monitor-exit v4

    .line 94
    return-void

    .line 69
    :catchall_0
    move-exception v5

    monitor-exit v4
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v5
.end method
